package com.wowangz.cms.component.datagrid.utils;

public class PaperStyle {
	
	/*
	 * 纸张类型
	 */
	public static class PaperType {
		
		public final static String A4 = "A4";
		public final static String A3 = "A3";
		
	}
	
	/*
	 * 纸张方向
	 */
	public static class PaperOrientation {
		
		public final static long VERTICAL = 1;    //纵向
		public final static long HORIZONTAL = 2;  //横向
		
	}
	
	/*
	 * 纸张大小
	 */
	public static class PaperSize {
		
		private long height;
		private long width;
		
		public PaperSize(long h, long w){
			height = h;
			width = w;
		}

		public long getHeight() {
			return height;
		}

		public long getWidth() {
			return width;
		}

	}

	public static PaperSize getPaperSize(String paperType, long paperOrientation) {
		
		if(paperType.equals(PaperType.A4)){
			if(paperOrientation == PaperOrientation.VERTICAL){
			    return new PaperSize(900, 1600);
			}
			else {
				return new PaperSize(1600, 900);
			}
		}
		else if(paperType.equals(PaperType.A3)){
			if(paperOrientation == PaperOrientation.VERTICAL){
			return new PaperSize(1791, 1600);
			}
			else {
				return new PaperSize(1600, 1791);
			}
		}
		else {
			return null;
		}

	}
}
